CKEDITOR.dialog.add( 'viewImage', function( editor )
    {
        return {
            title : 'Insert image',
            minWidth : 540,
            minHeight : 400,
            contents : [
            {
                id : 'tab1',
                label : '',
                title : '',
                expand:true,
                padding:0,
                elements :
                [ {
                    type : 'html',
                    id : 'content',
                    html :'<div>'+
                '<iframe src="/members/emailservice/upload-pictures/insert-file/" style="height: 400px; width: 540px;" id="insert_iframe" scrolling="auto" frameborder="0" style="border: 2px solid #ccc;" ></iframe >'
                +'</div>'
                }]
            }],
            buttons:[CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton],
            onOk : function() {
                // "this" is now a CKEDITOR.dialog object.
                // Accessing dialog elements:
                //var textareaObj = this.getContentElement( 'tab1', 'test111' );
                //CKEDITOR.dialog.getCurrent().destroy(); // close current dialog by your code
                    
                var imgObj = $("#insert_iframe").contents().find("#insertFile ul li img.select").attr("rel");
                if(imgObj){
                    var str = '<img src="' + imgObj + '"/>';
                    CKEDITOR.instances.ckeditor.insertHtml(str);
                }
               // return false; // if not close dialog
            }
        };
    } );